<?php
import("data.db.DbAbstractTable");
import("data.db.content.IContentBlock");

class DbSet extends DbAbstractTable implements IContentBlock {
	
	public $className = "data.logic.content.Set";
	const CLASS_NAME = "data.logic.content.Set";
	//
	// SQL Table description section
	//
	const TB_TABLENAME	= "pd_set";
	const TB_I			= 'set';
	
	const TB_TITLE		= 'set_title';
	
	public static function _get_TABLENAME() {return self::TB_TABLENAME;}
	public static function _get_ID() {return self::TB_I."_id";}
	public static function _get_SUFFIX() {return self::TB_I;}
	//
	//
	
	// properties
	public $title;
	
	public function __construct($noinit=false) {
		parent::__construct($noinit);
	}
	
	
	function getTitle() {
		return $this->title;
	}
	function setTitle($value) {
		$this->title = $value;
	}
	
	
	// restore
	function fillEntity($arrResult) {
		DbAbstractTable::fillEntity($arrResult);
		$this->setTitle($arrResult[self::TB_TITLE]);
	}
	
	//store
	function fillFields() {
		DbAbstractTable::fillFields();
		$this->fildsForStore[self::TB_TITLE] = "'".$this->getTitle()."'";
	}
	
	// same for all classes
	public static function findAll() {return DbAbstractTable::findAll(self::CLASS_NAME);}
    public static function findById($id) {return DbAbstractTable::findById($id, self::CLASS_NAME);}
}
?>